#ifndef CLCOMLOG_H
#define CLCOMLOG_H

#include <QtCore/qglobal.h>

#include "CLComLibrarys_global.h"
//CLCOMLIBRARYS_EXPORT

enum ENUM_CLCOMLOGEX_LEVEL
{
    ENUM_CLCOMLOG_LEVEL_ALL=0,
    ENUM_CLCOMLOG_LEVEL_ERROR,
    ENUM_CLCOMLOG_LEVEL_IMPORTANT,
    ENUM_CLCOMLOG_LEVEL_MINI,
};
enum ENUM_CLCOMLOGEX_FILET_FORMATYPE
{
    ENUM_CLCOMLOGEX_FILET_FORMATYPE_AUTO = 0,
    ENUM_CLCOMLOGEX_FILET_FORMATYPE_INPUT,
};
enum ENUM_CLCOMLOGEX_PREFIX
{
    ENUM_CLCOMLOGEX_PREFIX_ALL = 0,
    ENUM_CLCOMLOGEX_PREFIX_NO,
    ENUM_CLCOMLOGEX_PREFIX_FILENAME,
    ENUM_CLCOMLOGEX_PREFIX_GDI,
    ENUM_CLCOMLOGEX_PREFIX_MEMORY,
    ENUM_CLCOMLOGEX_PREFIX_TIME,
    ENUM_CLCOMLOGEX_PREFIX_SMILE,
    ENUM_CLCOMLOGEX_PREFIX_COUNT,
};

using namespace std;

class CLCOMLIBRARYS_EXPORT CLComLog
{
public:
    static CLComLog* GetLogInstance(const char* keystr = "default");

public:
    //根据格式打印，返回打印的字符数目
    virtual int sprintfLog(int level, int line, const char* filename, const char* szFormat, ...) = 0;

    //根据格式打印，返回打印的字符数目
    virtual int sprintfLog(int line, const char* filename, const char* szFormat, ...) = 0;

public:
    //设置日志路径
    virtual  void SetLogPath(const char* path, bool bFlag) = 0;

    //获取日志打印路径
     virtual  void GetPath(char* path, int pathlen) = 0;

    //设置日志打印等级，只有该等级的日志打印，0为全部打印
     virtual  void SetLogLevel(int n) = 0;

    //设置保存天数
     virtual  void SetSaveDays(int nDays) = 0;

    //单行日志最大字节数
     virtual  void SetLineMaxBytes(int nMaxBytes) = 0;	//单行日志最大字节数

    virtual void SaveLogs() = 0;

    virtual const char* SetFileName(QString logfilename) = 0;

    virtual void SetFilenameFormat(
        ENUM_CLCOMLOGEX_FILET_FORMATYPE ftype) = 0;

    virtual void SetPrefixStyle(
        ENUM_CLCOMLOGEX_PREFIX style) = 0;

    virtual void AddPrefixStyle(
        ENUM_CLCOMLOGEX_PREFIX style) = 0;

    virtual void RemovePrefixStyle(
        ENUM_CLCOMLOGEX_PREFIX style) = 0;

    virtual void LogoutShortFileName() = 0;
    virtual void LogoutFullFileName() = 0;
};

#endif // CLCOMLOG_H
